// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  runtimeConfig: {
    public: {
      apiBase: process.env.NUXT_PUBLIC_API_BASE_URL,
    },
  },
  routeRules: process.env.NUXT_PUBLIC_USE_MOCK_API === 'true'
    ? {}
    : {
        '/api/**': {
          proxy: {
            to: `${process.env.NUXT_PUBLIC_API_BASE_URL}/**`,
          },
        },
      },
  app: {
    head: {
      title: '小满虫之家',
      meta: [
        {
          name: 'description',
          content: "项目介绍暂无"
        }
      ]
    }
  },
  compatibilityDate: '2025-05-15',
  devtools: {
    enabled: true,
  },
  modules: [// 使用包名（推荐用法）
    '@nuxtjs/tailwindcss',
    '@pinia/nuxt',
    '@nuxt/image',
    'motion-v/nuxt',
    '@element-plus/nuxt',
  ],
  css: ['~/assets/css/tailwind.css'],
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "~/assets/css/element-theme.scss" as *;`,
        },
      },
    },
  },
  elementPlus: {
    importStyle: 'scss',
  }
})